package com.you.atlas.web.place.module.screen;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.citrus.service.form.Group;
import com.alibaba.citrus.turbine.Context;
import com.alibaba.citrus.turbine.dataresolver.FormGroup;
import com.alibaba.citrus.turbine.dataresolver.Param;
import com.you.atlas.biz.place.service.PlaceQueryService;
import com.you.place.dal.dao.dataobject.PlaceDO;


public class PlaceAdd {

    @Autowired
    private PlaceQueryService placeQueryService;

    public void execute(@FormGroup("addPlace") Group group, @Param("id") Long placeId, Context context) {

        PlaceDO placeDO = placeQueryService.find(placeId);
        if (placeDO != null) {
            group.getField("location").addValue(placeDO.getName());
        }
    }
}
